<!doctype html>
<html lang="en">
 <head>
  <meta charset="UTF-8">
  <meta name="Generator" content="EditPlus®">
  <meta name="Author" content="">
  <meta name="Keywords" content="">
  <meta name="Description" content="">
  <title>企业审计画像</title>
    <script src="../ruoyi/js/echartsjs/echarts.js"></script>
    <script src="../ruoyi/js/jquery-ui-1.10.4.min.js"></script>
    <script src="../ruoyi/js/echarts.min.js"></script>
 </head>
  <body>
    <!-- 为ECharts准备一个具备大小（宽高）的Dom -->
    <div id="main" style="width: 1200px;height:600px;"></div>
    <script type="text/javascript">
     // 基于准备好的dom，初始化echarts实例
      var myChart = echarts.init(document.getElementById('main'));
 
      // 指定图表的配置项和数据
       var years = ['2009','2010','2011','2012','2013','2014','2015','2016','2017','2018','2019'];
        var jdData =[
            ['虚构利润','虚列资产','虚假记载','推迟披露','重大遗漏','披露不实','欺诈上市','出资违规','擅自改变资金用途','占用公司资产','内幕交易','违规买卖股票','操纵股价','违规担保','一般会计处理不当','其他'],
            ['虚构利润','虚列资产','虚假记载','推迟披露','重大遗漏','披露不实','欺诈上市','出资违规','擅自改变资金用途','占用公司资产','内幕交易','违规买卖股票','操纵股价','违规担保','一般会计处理不当','其他'],
           ['虚构利润','虚列资产','虚假记载','推迟披露','重大遗漏','披露不实','欺诈上市','出资违规','擅自改变资金用途','占用公司资产','内幕交易','违规买卖股票','操纵股价','违规担保','一般会计处理不当','其他'],
		   ['虚构利润','虚列资产','虚假记载','推迟披露','重大遗漏','披露不实','欺诈上市','出资违规','擅自改变资金用途','占用公司资产','内幕交易','违规买卖股票','操纵股价','违规担保','一般会计处理不当','其他'],
		   ['虚构利润','虚列资产','虚假记载','推迟披露','重大遗漏','披露不实','欺诈上市','出资违规','擅自改变资金用途','占用公司资产','内幕交易','违规买卖股票','操纵股价','违规担保','一般会计处理不当','其他'],
		   ['虚构利润','虚列资产','虚假记载','推迟披露','重大遗漏','披露不实','欺诈上市','出资违规','擅自改变资金用途','占用公司资产','内幕交易','违规买卖股票','操纵股价','违规担保','一般会计处理不当','其他'],
		   ['虚构利润','虚列资产','虚假记载','推迟披露','重大遗漏','披露不实','欺诈上市','出资违规','擅自改变资金用途','占用公司资产','内幕交易','违规买卖股票','操纵股价','违规担保','一般会计处理不当','其他'],
		   ['虚构利润','虚列资产','虚假记载','推迟披露','重大遗漏','披露不实','欺诈上市','出资违规','擅自改变资金用途','占用公司资产','内幕交易','违规买卖股票','操纵股价','违规担保','一般会计处理不当','其他'],
		   ['虚构利润','虚列资产','虚假记载','推迟披露','重大遗漏','披露不实','欺诈上市','出资违规','擅自改变资金用途','占用公司资产','内幕交易','违规买卖股票','操纵股价','违规担保','一般会计处理不当','其他'],
		   ['虚构利润','虚列资产','虚假记载','推迟披露','重大遗漏','披露不实','欺诈上市','出资违规','擅自改变资金用途','占用公司资产','内幕交易','违规买卖股票','操纵股价','违规担保','一般会计处理不当','其他'],
		   ['虚构利润','虚列资产','虚假记载','推迟披露','重大遗漏','披露不实','欺诈上市','出资违规','擅自改变资金用途','占用公司资产','内幕交易','违规买卖股票','操纵股价','违规担保','一般会计处理不当','其他']]
        var data =[
			[24,5,102,120,157,21,4,0,3,28,11,31,0,16,78,207],
			[23,1,129,145,195,30,2,0,16,22,17,64,0,23,104,279],
			[38,7,188,216,299,46,2,0,23,28,23,77,2,31,152,446],
			[46,10,241,261,325,66,2,0,21,32,37,75,1,30,168,522],
			[56,11,204,272,295,82,1,0,18,35,21,137,2,27,130,439],
			[64,12,190,271,274,85,1,0,12,31,24,144,9,23,80,404],
            [87,13,217,362,324,103,0,0,19,39,29,251,5,23,92,510],
            [81,14,236,394,299,57,0,0,25,64,35,121,3,44,97,460],
            [50,0,277,437,249,29,0,0,26,86,21,128,2,79,97,433],
			[20,4,259,395,223,19,0,0,26,93,3,113,0,88,82,484],
			[4,3,133,169,99,9,0,0,9,57,0,99,0,40,43,218]
        ];
       
        option = {
                  
            baseOption: {
                 timeline: {
                data: years,
                axisType: 'category',
                autoPlay: true,
                playInterval: 2000,
                left: '10%',
                right: '10%',
                bottom: '0%',
                width: '100%',
                //  height: null,
                label: {
                    normal: {
                        textStyle: {
                            
                            color: '#ff8800',
                        }
                    },
                    emphasis: {
                        textStyle: {
                            color: '#fff'
                        }
                    }
                },
                symbolSize: 10,
                lineStyle: {
                    color: '#555'
                },
                checkpointStyle: {
                    borderColor: '#777',
                    borderWidth: 2
                },
                controlStyle: {
                    showNextBtn: true,
                    showPrevBtn: true,
                    normal: {
                        color: '#ff8800',
                        borderColor: '#ff8800'
                    },
                    emphasis: {
                        color: '#aaa',
                        borderColor: '#aaa'
                    }
                },

            },
                title: {
                    text: '十六类审计违规统计',
                    right: '2%',
                    bottom: '8%',
                    textStyle: {
                        fontSize: 50,
                        color: '#666'
                    }
                },
                tooltip: {
                    'trigger': 'axis'
                },
                calculable: true,
                grid: {
                    left: '8%',
                    right: '2%',
                    bottom: '6%',
                    top:'10%',
                    containLabel: true
                },
                label:{
                    normal:{
                        textStyle:{
                            color:'#fff'
                        }
                    }
                },
                yAxis: [{
                      offset: '37',
                    'type': 'category',
                    data: '',
                    nameTextStyle:{
                        color:'#fff'
                    },
                    axisLabel:{
                        //rotate:45,
                        textStyle:{
                            fontSize:12,
                            color:'#333',
                        },
                        interval: 0
                    },
                    axisLine:{

                        lineStyle:{
                            color:'#333'
                        },
                    },
                    splitLine:{
                        show:false,
                        lineStyle:{
                            color:'#333'
                        }
                    },

                }],
                xAxis: [{
                    'type': 'value',
                    'name': '',
                   
                    splitNumber:8,
                    nameTextStyle:{
                        color:'#333'
                    },
                    axisLine:{
                        lineStyle:{
                            color:'#333'
                        }
                    },
                    axisLabel: {
                        formatter: '{value} '
                    },
                    splitLine:{
                        show:true,
                        lineStyle:{
                            color:'#ccc'
                        }
                    },
                }],
                series: [{
                    'name': '',
                    'type': 'bar',
                    markLine : {
                        label:{
                            normal:{
                                show:false
                            }
                        },
                        lineStyle:{
                            normal:{
                                color:'red',
                                width:11
                            }
                        },
                    },
                    barWidth:'50%',
                    label: {
                        normal: {
                            show: true,
                            position: 'inside',
                            formatter: '{c}'
                        }
                    },
                    itemStyle: {
                        normal: {
                            color: function(params) {
                                // build a color map as your need.
                                var colorList = [
                                    '#bcd3bb', '#e88f70', '#9dc5c8', '#e1e8c8',
                                    '#7b7c68', '#e5b5b5', '#f0b489', '#928ea8',
                                    '#bda29a', '#376956', '#c3bed4', '#495a80',
                                    '#9966cc', '#bdb76a', '#eee8ab', '#a35015',
                                    '#04dd98', '#d9b3e6', '#b6c3fc','#315dbc',
                                ];
                                return colorList[params.dataIndex]
                            },

                        }
                    },
                }],
                animationDurationUpdate: 2000,
                animationEasingUpdate: 'quinticInOut'
            },
            options: []
        };
        for (var n = 0; n < years.length; n++) {
            
                   var res = [];
       //alert(jdData.length);
           for(j=0;j<data[n].length;j++){
                res.push({
                name: jdData[n][j],
                value: data[n][j]
            });
         
}

res.sort(function(a, b) {
        return b.value - a.value;
    }).slice(0, 6);

res.sort(function(a, b) {
    return a.value - b.value;
});
var res1=[];
var res2=[];
      //console.log(res);
      for(t=0;t<res.length;t++){
          res1[t]=res[t].name;
            res2[t]=res[t].value;
      }
        console.log(res1);
        console.log("----------------");
          console.log(jdData[n]);
            option.options.push({
                title: {
                    text: years[n] +'年审计违规数量统计',
					x: 'center',
					y: 'top'
                },
                yAxis:{
                    data:res1,
                },
                series: [{
                    data: res2
                }]
            });
        }  
 
      // 使用刚指定的配置项和数据显示图表。
      myChart.setOption(option);
	</script>
  </body>
</html>
